HP Bar Setup Assistant

 

Most MUDs allow the user to view their player status each round automatically.  This comes in the form of what’s known as an “HP bar.”  Normally, the HP bar is a single line of information that displays a condensed snapshot of a player’s status (HP, SP, etc.).  Below is an example of what an HP bar might look like.

 

HP:50/100 SP:40/150 Enemy:[Death]

 

Where HP=Hit Points, SP=Spell points, Enemy=Enemy status (damage)

 

Now, using events, Portal© allows you to match the pattern of your HP bar, and populate the graphical (and numeric) HP Bars on the bottom of the Main Screen.  The Portal© HP Bars are visible as you choose using the Options menu.

 

Setting up an HP bar event can be somewhat complex, especially since there are literally thousands of different HP bar formats out there, and that’s where the HP Bar Assistant comes in.  It works you step by step through the creation of an event that will end up automatically populating the HP values, customized for your MUD.

 

Note: The HP Bar Assistant will work with most MUD HP bars, but for some of the more complex HP bars out there, you may have to manually edit the resulting event after using the assistant.  In any event, this will give you a bit more exposure to the theory of events and variable usage.

 

To begin, you need to select the HP Bar Setup Assistant under the Options menu.  Once you do this, you need to paste a copy of your MUD’s HP bar into the field provided.  The easiest way to do this is to select the HP bar from the Main Screen, then bring up the assistant.

 

Note: Try and get an actual copy of the actual HP bar from your MUD, rather than trying to build it from scratch.  The values that appear (like if you’re at half HP, etc.) don’t matter so just grab a clean copy of the HP bar and you’re ready to go.

 

Once you’ve copied the HP bar, press the Ready button.  For the below examples, we’re going to use the HP bar from before:

 

HP:50/100 SP:40/150 Enemy:[Death]

 

Now you’re ready to rock.  You’ll notice that the HP/Max HP gauge is flashing dark red.  What you need to do now is select the current HP value in the HP bar.  In this case, it’s the number 50.  Highlight it using the mouse (click-drag-unclick) or the keyboard (shift+left/right arrow keys) and then click the Next button.  You’ll then see the example change to this:

 

HP:50/100 SP:40/150 Enemy:[Death]

 

This indicates that you’ve selected the 50 as the current HP.  Now the HP gauge is flashing brighter red.  Now it’s asking for the Max HP value.  Select the 100 and then Click Next.  Here’s what the bar will then look like:

 

HP:50/100 SP:40/150 Enemy:[Death]

 

Now the SP gauge is flashing.  Just as you did for the HP values, grab the SP and then the Max SP value and you’ll end up with this:

 

HP:50/100 SP:40/150 Enemy:[Death]

 

After you do this, the GP1 (guild point 1) gauge will flash.  Since we aren’t using GP1 or GP2 in this example, simply skip them both by pressing the Skip button twice.  Once you do this, the enemy gauge will then begin flashing, asking for you to select the enemy status.  Do so (it’s “Death” here) and then click Next.

 

Another screen will then appear (Setup Enemy Status), asking you how to deal with the enemy status.  The enemy status gauges on Portal© are based on a percentage.  If your MUD displays this actual percentage in your HP bar, that’s easy.  You’d just have selected the number (not including the % sign) and then you’ll click the Actual % button.

 

Our example doesn’t have a percentage though, it only has words that describe the current status of the enemy.  For our example, we’ll say that our MUD defines enemy status in 4 steps: Good, Bruises, Emergency and Death.  In this case, we need to somehow assign them numeric values so that the enemy gauge will work.  We’ll do this via the @() case function Portal© offers.  Relax, this screen gives you a nice way to generate one.

 

We need to define a value for each word as a reflection of the percentage of the enemy’s status.  First we’ll use Death.  We’ll consider Death to be 10% health, so enter Death into the string Field and 10 into the value field, then click the Add Case button.  You’ll see “Death=10” in the Case listing.  Next do Emergency and assign it 40.  Continue with Bruises as 70 and Good as 100.  When you’re done, you’ll have 4 cases, one for each word possibility, in the Case list.  When you’ve completed this, click the Accept & Generate Case Statement button and you’ll be back to the HP Bar Assistant screen, with the following lines filled in:

 

MUD Hp Bar

HP:50/100 SP:40/150 Enemy:[Death]

 

This shows what values (the italicized, colored ones) will be replaced by variables in the event text.

 

Event Text Review

HP:*/* SP:*/* Enemy:[*]

Variables

@HP,@MAXHP,@SP,@MAXSP,@AA

 

The Event Text Review is the actual event pattern-match text that will become a real event.  The *’s will be populated to the variables listed.  In this example, the system-resident variable @AA is used to “hold” the value of the enemy status, to then be used in the @() case statement.

 

Enemy Status

@(@AA,Death=10,Emergency=40,Bruises=70,Good=100)

 

This is the case statement that will be used to populate the enemy status gauge.  The value that will be compared against the cases (Death, Emergency, etc.) will be the enemy status, which is held in the variable @AA.

 

Dummy Variables

After you’ve gotten this far, you need to think about using dummy variables.  In our example, we don’t need them, since the event text will always match the MUD’s HP bar.  If, however, there’s some text in the event text that isn’t always the same, you’ll need to add a dummy variable to accommodate it.  Otherwise, the event won’t match pattern.

 

Let’s say our HP bar was this instead:

 

HP:50/100 SP:40/150 Dragon:[Death]

 

Now, “Dragon” isn’t always constant, since you most likely will fight other things as well.  Using the above HP bar, the Event Text/Variables fields would become:

 

Event Text Review

HP:*/* SP:*/* Dragon:[*]

Variables

@HP,@MAXHP,@SP,@MAXSP,@AA

 

This won’t work, unless you fight a dragon.  It won’t work because the pattern of “Dragon” will only work when you are actually fighting a dragon.  What you need to do here is highlight the word “Dragon” in the event text, then click the Add Dummy Variable button.  When you do this, the fields will change to this:

 

Event Text Review

HP:*/* SP:*/* *:[*]

Variables

@HP,@MAXHP,@SP,@MAXSP,<@>,@AA

 

The word Dragon was replaced by a *, and another variable (<@>)has been added to the variables.  This means that you want to match the pattern against any named monster, but not use the value anywhere.  That’s what dummy variables are used for.  You could actually use this value later, but you’d have to edit the event via the Events screen later.

 

Ok, so back to the original example, we don’t need to use any dummy variables, so click the Next button.  It’ll ask you to review the texts, and then click Accept to create the actual event.  Do so, and you should be all set!  Remember though, this was for our example, you will need to do the same steps but with an example HP bar from your own MUD.

 

Whenever you desire, you can then go in and modify/delete the event via the Events screen.